<?php $this->fetch('public/head') ?>
<div class="layui-tab layui-tab-brief">
    <ul class="layui-tab-title">
        <li class="layui-this">总经理列表</li>
    </ul>
    <div class="layui-tab-content">
        <div class="layui-tab-item layui-show">
            <form class="layui-form form-container" action="<?php echo url('manager') ?>" method="post">

                <div class="layui-form-item">
                    <label class="layui-form-label">总经理列表</label>
                    <div class="layui-input-block">
                        <button type="button" class="layui-btn" id="userlist">
                            <i class="layui-icon">&#xe67c;</i>添加</button>
                        <div >
                            <?php foreach ($list as $v) {?>
                                <div class="photo-list">
                                    <input type="text" name="user_name[]" value="<?php echo get_user_info_new($v)['name'] ?>" readonly="readonly" maxlength="100" autocomplete="off"  class="layui-input layui-input-inline">
                                    <input type="hidden" name="userid[]" value="<?php echo $v ?>" class="layui-input layui-input-inline">
                                    <button type="button" class="layui-btn layui-btn-danger remove-btn">移除</button>
                                </div>
                            <?php }?>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit lay-filter="*">保存</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<?php $this->fetch('public/script') ?>
<script>
    $('#userlist').click(function () {
        layer.open({
            type:2,
            title:false,
            area:['80%','80%'],
            content:HS.U('<?php echo url('put_manager') ?>'),
            end:function () {
                location.reload();
            }
        })
    })
    $('.remove-btn').click(function () {
        var oDiv = $(this).parent('.photo-list');
        oDiv.remove();
    })
</script>